package com.zhuss.util;


public class Test01 {
	
	public static void main(String[] args) throws InterruptedException {
//		Long[] l = new Long[]{1l,2l};
//		System.out.println(JsonUtil.toJson(l));
		
		A a = new A();
		
		
		for (int i = 0; i < 1000; i++) {
			new Thread(()-> {
				a.test();
			}).start();
		}
	}

}

class A {
	int i = 0;
	Object obj = new Object();
	public void test() {
		synchronized (obj) {
			if (i < 100) {
				i ++;
			}
			System.out.println("0000000000000==========" + i);
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}